package com.lc.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.cnpc.framework.utils.DateUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @Description  
 * @Author  Keroro
 * @Date 2024-06-28 
 */

@Setter
@Getter
@ToString
@Entity
@Table ( name ="app_wj_result" )
public class AppWjResult  implements Serializable {

	private static final long serialVersionUID =  1505789646725466751L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id")
	private Long id;

   	@Column(name = "createtime" )
	private String createtime;

   	@Column(name = "updatetime" )
	private String updatetime;

	/**
	 * 问卷编码
	 */
   	@Column(name = "wjCode" )
	private String wjCode;

	/**
	 * 问卷名称
	 */
	@Column(name = "wjName" )
	private String wjName;

	/**
	 * 用户id
	 */
   	@Column(name = "userId" )
	private int userId;
	/**
	 * 用户名称
	 */
	@Column(name = "userName" )
	private String userName;

	/**
	 * 得分
	 */
   	@Column(name = "point" )
	private int point;

	/**
	 * 状态
	 */
   	@Column(name = "state" )
	private int state;

   	@Column(name = "remark" )
	private String remark;

	@Transient
	private String token;

	@Transient
	List<AppWjResultItem> wjResultItemList;

	public void setDefaultTime(){
		String dateTime = DateUtil.format(new Date(),DateUtil.YYYY_MM_DD_HH_MM_SS);
		createtime = dateTime;
		updatetime = dateTime;
	}

	public void setDefaultCreateTime(){
		String dateTime = DateUtil.format(new Date(),DateUtil.YYYY_MM_DD_HH_MM_SS);
		createtime = dateTime;
	}

	public void setDefaultUpdateTime(){
		String dateTime = DateUtil.format(new Date(),DateUtil.YYYY_MM_DD_HH_MM_SS);
		updatetime = dateTime;
	}

}
